import request from "@/utils/request.js";
/**
 * 列表查询
 * @param params
 */
export const channelPage = query => {
  return request({
    url: `/purchase/channel/manage/page`,
    method: "get",
    params: query
  });
};
/**
 * 添加一级渠道
 * @param params
 */
export const addFirstLevel = data => {
  return request({
    url: "/purchase/channel/manage/addFirstLevel",
    method: "post",
    data
  });
};

/**
 * 查询渠道详情
 * @param params
 */
export const channelDetail = channelTenantId => {
  return request({
    url: `/purchase/channel/manage/detail/${channelTenantId}`,
    method: "get"
  });
};

/**
 * 编辑渠道
 * @param params
 */
export const edit = data => {
  return request({
    url: `/purchase/channel/manage/edit/${data.channelTenantId}`,
    method: "post",
    data
  });
};

/**
 * 导出
 * @param params
 */
export const manageExport = query => {
  return request({
    url: "/purchase/channel/manage/export",
    method: "get",
    params: query,
    responseType: "blob"
  });
};
